<?php
$this->Html->addCrumb('Newsletters', '/member/newsletters');
$this->Html->addCrumb('Add');
?>
<?php 
$this->Html->scriptStart(array('inline' => false));
echo '
      $(function(){
        $("#NewsletterMemberAddForm").TWS_Form( {
          validate : {
          rules : {
            NewsletterTitle : {required : true, help : "This is the title for the newsletter"},
            NewsletterFilePath: {required : true, help : "Select the newsletter to be uploaded"},
            NewsletterNewsletterDate : {required : true, date:true, help : "This is the date when the newsletter was published. It will assist in determining the sort order when newsletters are displayed. The most recent newsletters are displayed first."}
          }
          }});
        });
       ';
$this->Html->scriptEnd();
?>
<h1>Add Newsletter</h1>

<?php echo '<div id="actionLink">'.$this->Html->link('Back to list of Newsletters',array('action'=>'index', 'member'=>true)).'</div>'; ?>

<?php echo $this->element('errors', array('errors' => isset($errors)? $errors : null)); ?>
<?php

echo $this->TWSForm->create('Newsletter',  array(
    'inputDefaults' => array(
        'div' => array('class'=>'row')),
        'class'=>'inlineForm',
        'type'=>'file'));

echo $this->TWSForm->input('title', array('name'=>'NewsletterTitle', 'type'=>'text', 'size'=>'65', 'label'=>'<span class="required">*</span>Title'));
echo $this->TWSForm->input('file_path', array('type'=>'file', 'label'=>'<span class="required">*</span>Upload newsletter', 'name'=>'NewsletterFilePath'));
echo $this->TWSForm->input('newsletter_date', array('type'=>'text', 'rel'=>'date', 'label'=>'<span class="required">*</span>Newsletter date', 'name'=>'NewsletterNewsletterDate'));
echo $this->TWSForm->end( array("label"=>"Add", "class"=>"button"));


?>